package chatdto

import (
	"time"
	"xr-game-server/entity"
)

type PushChatDto struct {
	// 聊天对象信息
	ChatObj *ChatDto `json:"chatObj" dc:"聊天对象信息"`
	Content string   `json:"content" dc:"内容"`
	Param   []string `json:"param" dc:"参数"`
	Time    string   `json:"time" dc:"时间"`
}

func NewPushChatDto(role *entity.PlayerRole, content string, param []string) *PushChatDto {
	ret := new(PushChatDto)
	ret.ChatObj = NewChatDto(role)
	ret.Content = content
	ret.Param = param
	//指定时间格式
	ret.Time = time.Now().Format("2006-01-02 15:04:05")
	return ret
}
